package com.test.threads.example02;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TraditionalTimerTest2 {


    public static void main(String[] args) throws InterruptedException {
        new Timer().schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println("timetask run");
                new Timer().schedule(new TimerTask() {
                    @Override
                    public void run() {
                        System.out.println("boming");
                    }
                },2000);
            }
        },2000);


        while (true){
            System.out.println(new Date().getSeconds());
            Thread.sleep(1000);
        }
    }

}
